<?php
	// Example for moving file, used by service.
	
	// For logging usage.
	require_once('service-log.php');	
	
	$rootFolder  	= dirname(__FILE__);
	$inputFolder 	= $rootFolder . '/in/';
	$outputFolder 	= $rootFolder . '/out/';
	
	if ($handle = opendir($inputFolder)) {
		while (false !== ($inputFile = readdir($handle))) {
			if (is_dir($inputFile))
				continue;
			if (substr($inputFile, 0, 1) == '.')
				continue;
			echo $inputFile . "\n";					
			setLog('MOVE-FILE : Moving file from ' . $inputFolder . $inputFile . ' to ' . $outputFolder . $inputFile);
			rename($inputFolder . $inputFile, $outputFolder . $inputFile);
		}	
	}
	
	$GLOBALS['action'] = true;
	
	
	// End of file